cmake_minimum_required(VERSION 2.8)
project(AndresVision CXX)

set(PROJECT_VERSION_MAJOR 0)
set(PROJECT_VERSION_MINOR 1)
set(PROJECT_VERSION_PATCH 0)
set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})

set(ANDRES_CXX_FLAGS "-std=c++0x")
set(CMAKE_CXX_FLAGS "${ANDRES_CXX_FLAGS} -Wall -pedantic -g")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DEIGEN_NO_DEBUG")

set(CMAKE_BUILD_TYPE "debug")

option(ANDRES_BUILD_EXAMPLES "Build the examples" ON)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake_modules")
set(ANDRES_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules")
set(PROJECT_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/include")

find_package(Eigen3 REQUIRED)
find_package(rapidjson REQUIRED)

include_directories(
    ${PROJECT_INCLUDE_DIR}
    ${Eigen3_INCLUDE_DIR}
    ${ANDRES_MODULE_PATH}
    ${RAPIDJSON_INCLUDE_DIRS}
)

add_subdirectory("modules/autosdk_hdmap")
add_subdirectory("modules/lane_full_matching")
add_subdirectory("modules/kalman_filter")
add_subdirectory("modules/output")
add_subdirectory("modules/base")
add_subdirectory("modules/tracking")
add_subdirectory("modules/vectorization")
add_subdirectory("modules/sign_pole_matching")

file(GLOB src "${PROJECT_SOURCE_DIR}/src/*.cpp")
add_executable(localization_hdmap ${src})

target_link_libraries(localization_hdmap
    Base MapMiddleLayer
    LaneFullMatching
    Kalman_filter
    SignPoleMatching
    Tracking
    Output
    Vectorization
)